Currently, a battery in an electronic device is generally charged by coupling a communication interface of the electronic device to an external power adapter. During charging the battery, in order to shorten charging time, a charging current is increased in the related art for quick charging of the battery. However, for charging the battery either with conventional constant voltage or with increased charging current, if the charging voltage and/or the charging current for the battery is too large in the charging process, the battery will be damaged because of an overvoltage charging and/or an overcurrent charging. Therefore, the above mentioned charging methods cannot realize an overvoltage protection and/or an overcurrent protection for the battery in the electronic device during a conventional charging or a quick charging